package clothes.tools.service.impl;

import clothes.tools.dao.AdministratorDao;
import clothes.tools.dao.impl.AdministratorDaoImpl;
import clothes.tools.pojo.Administrators;
import clothes.tools.service.AdministratorsService;

public class AdministratorsServiceImpl implements AdministratorsService {
    private AdministratorDao administratorDao=new AdministratorDaoImpl();
    @Override
    public Administrators Login(Administrators administrators) {
        return administratorDao.queryByAdminsAndPassword(administrators.getUsername(),administrators.getPassword());
    }

    @Override
    public boolean existsUsername(String username) {
        if(administratorDao.queryByAdmins(username)==null){
            return false;
        }
        return true;
    }
}
